﻿using System.Web.Mvc;
using System.Web.Routing;
using Nop.Web.Framework.Mvc.Routes;

namespace Nop.Plugin.Pricing.PreciousMetals
{
    public class RouteProvider : IRouteProvider
    {
        public void RegisterRoutes(RouteCollection routes)
        {
            routes.MapRoute(
                "Plugin.Pricing.PreciousMetals.Configure",
                "Plugins/PreciousMetalsPricing/Configure/{productVariantId}",
                new { controller = "PreciousMetalsPricing", action = "Configure", productVariantId = "" },
                new[] {"Nop.Plugin.Pricing.PreciousMetals.Controllers"}
                );

            var route = routes.MapRoute("preciousmetaladmin-list",
                  "Admin/Plugins/PreciousMetals/Admin/{action}/{id}",
                  new { controller = "PreciousMetalsPricing", action = "List", id = "" },
                  new[] { "Nop.Plugin.Pricing.PreciousMetals.Controllers" }
             );

            route.DataTokens.Add("area", "admin");
            
        }

        public int Priority
        {
            get { return 0; }
        }
    }
}
